import React, {useEffect, FC, useState} from 'react'
import './index.less'
import { Link, useLocation } from 'react-router-dom'
import { connect } from 'react-redux'
import * as actions from '@/store/actions'


interface Props extends ReduxProps { }
const Bigview: FC<Props> = ({ storeData: { } }) => {
  const [currentexternalLink,setCurrentObjexternalLink] = useState(null);
  const { pathname } = useLocation()
  useEffect(() => {
    try {
      console.log(`pathname${pathname}`)

      let data = {
        "/bg/1":"http://pfzydd.sxwhoa.com:8088/webroot/decision/view/form?viewlet=T%252F%25E8%25AE%25BE%25E5%25A4%2587%25E5%25A4%25A7%25E5%25B1%258F.frm&ref_t=design&ref_c=24b35291-423e-4270-9a09-b3c6359a3ae3",
        "/bg/2":"http://pfzydd.sxwhoa.com:8088/webroot/decision/view/form?viewlet=T%252F%25E9%259B%2586%25E5%259B%25A2%25E5%25A4%25A7%25E5%25B1%258F.frm&ref_t=design&ref_c=24b35291-423e-4270-9a09-b3c6359a3ae3",
        "/bg/3":"http://pfzydd.sxwhoa.com:8088/webroot/decision/view/form?viewlet=demo%252F%25E9%25B9%258F%25E9%25A3%259E%25E7%2585%25A4%25E7%259F%25BF%25E7%25AE%25A1%25E7%2590%2586%25E9%25A9%25BE%25E9%25A9%25B6%25E8%2588%25B1_1920_1080V1.1_zsy.frm&ref_t=design&ref_c=24b35291-423e-4270-9a09-b3c6359a3ae3",
      }
      setCurrentObjexternalLink(data[pathname])
    } catch (error) {
      console.log(error)
    }
  }, [])
  return (
    <div className="Bigpage">
      <iframe style={{width:'100%',height:'100%',overflowY:'auto',margin:0,border:'0'}} src={currentexternalLink}></iframe>
    </div>
  )
}

export default connect(
  (state) => state,
  actions
)(Bigview)
